﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

using Antix.Data.Catalogue.Objects.SqlServer;

namespace Antix.ObjectsToDatabase.Addin
{
    [Serializable]
    public class BuilderProxy : MarshalByRefObject
    {
        public string Generate(string assemblyFilePath, string connectionString)
        {
            Assembly assembly = Assembly.LoadFile(assemblyFilePath);
            SqlDatabase db = new SqlDatabase(connectionString);

            Builder builder = new Builder();
            return builder.Generate(assembly, db);
        }
    }

}
